#include "boardregdialog.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <time.h>
#include <fcntl.h>
#include <sys/select.h>
//#include <linux/types.h>
#include <iostream>
using namespace std;
#include <QDebug>


#include <QLabel>
#include <QPushButton>
#include <QFont>
#include <QTimer>
#include <QFile>
#include <QTextStream>
#include <QDataStream>
#include <QString>
#include <QMessageBox>

BoardRegDialog::BoardRegDialog(QWidget *parent)
    : QDialog(parent)
{
    this->setFixedSize(300,240);
    setWindowTitle(tr("接口板登记"));
    infoLabel = new QLabel(this);
    infoLabel->setText(tr("是否重新登记?"));
    QFont f("unifont",12,QFont::Light);
    infoLabel->setFont(f);
    okPushButton = new QPushButton(tr("确定"),this);
    cancelPushButton = new QPushButton(tr("取消"),this);
    infoLabel->setGeometry(QRect(80,60,120,60));
    okPushButton->setGeometry(QRect(50,150,80,35));
    cancelPushButton->setGeometry(QRect(160,150,80,35));

    connect(okPushButton,SIGNAL(clicked()),this,SIGNAL(okPushButtonClicked()));
    connect(cancelPushButton,SIGNAL(clicked()),this,SIGNAL(cancelPushButtonClicked()));



}


void BoardRegDialog::regStartMessage()
{
    infoLabel->setText("接口板登记中...");
    okPushButton->setVisible(false);
    cancelPushButton->setVisible(false);

}
void BoardRegDialog::regFaultMessage()
{
    QMessageBox::information(this,tr("接口板登记"),tr("登记出错：can设备打开失败..."));
}
BoardRegDialog::~BoardRegDialog()
{
    delete(infoLabel);
    delete(okPushButton);
    delete(cancelPushButton);
}
